Skip to content

audio: kpb: enable HiFi4 optimized paths - #11452

Merged
lgirdwood merged 1 commit into
thesofproject:mainfrom
abonislawski:kpb_hifi4
Nov 13, 2026
Merged

lgirdwood merged 1 commit into
thesofproject:mainfrom
abonislawski:kpb_hifi4

Conversation

@abonislawski

Copy link
Copy Markdown
Member

Configure KPB circular buffers and HiFi intrinsics for optimized processing on HiFi4 cores.

Configure KPB circular buffers and HiFi intrinsics
for optimized processing on HiFi4 cores.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 08:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Simultaneous source/sink hardware wrapping and newly enabled HiFi5 intrinsics, including 24-bit helpers, require Cadence-toolchain and target-DSP validation beyond this source-only review.

No open issues 🎉

What changed in this PR

Enables optimized Key Phrase Buffer (KPB) processing on HiFi4 cores while preserving the existing HiFi3 paths.

Changes:

  • Adds HiFi4/HiFi5 feature selection and a shared KPB_HIFI guard.
  • Uses separate hardware circular buffers for input and output in HiFi4 microphone-selection copies.
  • Extends existing optimized sample-conversion paths to the newly selected cores.
File Description
src/​include/​sof/​audio/​kpb.h Defines HiFi4/HiFi5 selection and the shared HiFi optimization guard.
src/​audio/​kpb.c Adds HiFi4 intrinsics and circular-buffer copy paths; updates guards for shared optimized conversions.

Review effort: Balanced

@intel-sofci

Copy link
Copy Markdown

PR 11452: test results

Run date: 2026-11-13 08:27 UTC

Tested commit: 7ad6a51599aba022fc9a8762c12c45f9b9f1a49e

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

Comment thread src/audio/kpb.c
Comment on lines +1135 to +1140
#ifdef KPB_HIFI4
AE_SETCBEGIN0(audio_stream_get_addr(istream));
AE_SETCEND0(audio_stream_get_end_addr(istream));
AE_SETCBEGIN1(audio_stream_get_addr(ostream));
AE_SETCEND1(audio_stream_get_end_addr(ostream));
#else

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A later optimization could be to make these static inline per SIMD flavor with generic C version too. That way we can remove a lot of the compile time conditionals.

@lgirdwood
lgirdwood merged commit 08cc68d into thesofproject:main Nov 13, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants